/**
 * 系统日志模块
 */
#ifndef _SYSLOGGER_H_
#define _SYSLOGGER_H_

#include <iostream>
#include <string>

class SysLogger
{
public:

	static SysLogger* getInst();

	~SysLogger();

	void init(const std::string& logPath);

	void unInit();

	void setLevel(const bool recordInfo,
						const bool recordWarn,
						const bool recordErr);

	void logInfo(const char* format, ...);

	void logErr(const char* format, ...);

	void logWarn(const char* format, ...);

private:
	SysLogger();

	bool weirteToFile(const char* path, const  char* str);
	void getTime(char str[], const int maxSize);

private:
	static SysLogger* s_hand;

	bool _recordInfo;
	bool _recordWarn;
	bool _recordErr;
	std::string _logPath;
};

#endif // !_SYSLOGGER_H_
